package com.hdax.dm.utils.response;

import lombok.Data;

@Data
public class CommonResponse<T> {
    private String success;
    private String errorCode;
    private String msg;
    private T data;

    //成功响应
    public CommonResponse(T data){
        this.success="success";
        this.errorCode="0000";
        this.msg="";
        this.data=data;
    }

    //成功响应
    public CommonResponse(T data,String msg){
        this.success="success";
        this.errorCode="0000";
        this.msg=msg;
        this.data=data;
    }

    //失败响应
    public CommonResponse(String errorCode,String msg){
        this.errorCode=errorCode;
        this.msg=msg;
    }

    public CommonResponse(){

    }
}
